package com.whys;

public class Student extends  Person {

// 重写 当子类调用 不能够满足子类需求时可以重写
    // @Override
    @Override
    public void like(){
        super.like(); //this
        // 扩展的逻辑
        System.out.println("并且爱好敲代码");
    }

    public static void main(String[] args) {
//        Person person = new Person("张三","男","100");
//        Person person1 = new Person();
//        person1.setAge("18");
//        person1.setName("李四");

        // super() 超级
        Student student = new Student();
        student.setAge("18");
        student.setName("李四");
        student.like();
        // 重写




    }
}
